package org.supreme.basic.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.supreme.basic.dtovo.loginDto;
import org.supreme.basic.dtovo.wechatbangd;
import org.supreme.basic.result.JSONResult;
import org.supreme.basic.service.ILoginService;

import javax.validation.Valid;
import java.util.Map;

@RestController
@RequestMapping("/login")
public class loginController {
    @Autowired
    private ILoginService loginService;
    @RequestMapping("/login")
    public JSONResult login(@RequestBody @Valid  loginDto dto){
        return loginService.login(dto);
    }

    /**
     * 微信扫码
     * @param map
     * @return
     */
    @PostMapping("/wechat")
    public JSONResult wechat(@RequestBody Map<String,String> map){
        return loginService.wechat(map);

    }
    /**
     * 微信扫码绑定接口
     * @param map
     * @return
     */
    @PostMapping("/wechatbangd")
    public JSONResult wechatbangd(@RequestBody wechatbangd we){
        return loginService.wechatbangd(we);

    }

}
